<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // throw '错误信息';
    // throw 55555;
    // function UserException (message) {
    //     this.message = message;
    //     this.name = 'UserException';
    // }
    // throw new UserException('自定义错误信息');
    try {
        try {
            throw new Error("oops");
        } catch (ex) {
            console.error("inner", ex.message);
            throw ex;
        } finally {
            console.log("finally");
        }
    } catch (ex) {
        console.error("outer", ex.message);
    }

    function myConcat (separator, ...args) {
        let result = ""; // 初始化列表
        console.log("~~~ar~", [...arguments], Array.from(arguments));
        //   arguments.forEach((item)=>{console.log("item",item);})
        // 迭代 arguments
        for (let i = 0; i < args.length; i++) {
            result += args[i] + separator;
        }
        return result;
    }
    myConcat("-", 1, 2, 3, 5,)
    console.log("~~f~d", 5 & 6);
    const add = 55
    let ff = 1;
    add ?? (ff = 2);
    console.log("FFF", ff);
    const g = {
        name: "fd"
    }
    const o = (g instanceof Date)
    console.log("FssssF", o);
</script>

</html>